#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

void reverse(char str[]);
int main()
{
	char str[] = "abcdefgh";
	reverse(str);
	printf("%s", str);
	return 0;
}

void reverse(char str[])
{
	int len = strlen(str);

	char ch = *str;
	*str = str[len - 1];

	str[len - 1] = '\0';
	if (strlen(str + 1) >= 2)
	{
		reverse(str + 1);
	}
	str[len - 1] = ch;
}
